import com.wyl.mapper.UserMapper
import com.wyl.utils.getSqlSession
import org.junit.Test
import org.springframework.beans.factory.getBean
import org.springframework.context.support.ClassPathXmlApplicationContext

class MybatisTest {
    @Test
    fun test() {
        getSqlSession().use {
            val mapper = it.getMapper(UserMapper::class.java)
            mapper.getUserList().forEach(::println)
        }
    }

    @Test
    fun test2(){
        val context = ClassPathXmlApplicationContext("applicationContext.xml")
        val mapper = context.getBean<UserMapper>("userMapper")
//        val mapper = context.getBean<UserMapper>("userMapper2")
        mapper.getUserList().forEach(::println)
    }
}